//
//  ViewController.m
//  audioplayer
//
//  Created by iD Student on 7/16/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    NSURL *url = [NSURL fileURLWithPath:@"/Users/Student/Desktop/Ali - iOS/audioplayer/Skyrim_Theme.mp3"];
    audioPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:nil];
    
    [audioPlayer prepareToPlay];
    
    
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {
        return YES;
    }
}
- (IBAction)playButton:(id)sender 
{
    [audioPlayer play]; 
    
}

- (IBAction)pauseButton:(id)sender 
{
    [audioPlayer pause]; 
    
}




@end
